<template>
	<view class="withdrawal-record-detail-layout">
		<!-- 提现状态 -->
		<view class="withdrawal-record-detail-status">
			<image src="/static/wallet/wallet_status_waiting_icon@2x.png" mode="aspectFit"></image>
			<text>{{statusText()}}</text>
		</view>
		<!-- 提现记录信息 -->
		<view class="withdrawal-record-detail-info">
			<view class="withdrawal-record-detail-cell">
				<text>提现单号</text>
				<text>{{jsonData.orderId}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>结算时间</text>
				<text>{{jsonData.accountingTime}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>提现时间</text>
				<text>{{jsonData.withdrawTime}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>提现账户</text>
				<text>{{jsonData.withdrawWallet}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>提现银行</text>
				<text>{{jsonData.bankName}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>提现金额</text>
				<text>{{jsonData.withdrawAmount}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>{{jsonData.settleType == '0' ? '提现单笔手续费' : '提现手续费'}}</text>
				<text>{{formatPayFee()}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>考核扣款</text>
				<text>{{jsonData.checkAmount}}</text>
			</view>
			<view class="withdrawal-record-detail-cell">
				<text>实际到账</text>
				<text>{{jsonData.amount}}</text>
			</view>
		</view>
		<text class="withdrawal-record-detail-bottom">
			<text>如有疑问请致电客服</text>
			<text @tap="callMakeTel">{{CUSTOMSERVICE_TEL}}</text>
		</text>
	</view>
</template>

<script setup>
	import { CUSTOMSERVICE_TEL } from '@/common/config/config.js'
	const props = defineProps(['data'])
	const jsonData = JSON.parse(decodeURIComponent(props.data || '{}'))
	console.log(jsonData)
	const formatPayFee = () => {
		return jsonData.settleType == '0' ? jsonData.commissionCharges : `${jsonData.withdrawAmount}*${jsonData.taxPoint}%+${jsonData.commissionCharges}`
	}
	// 提现状态文字
	const statusText = ()=>{
		if(jsonData.status == '0'){
			return '待出款'
		}
		else if(jsonData.status == '1'){
			return '出款成功'
		}
		else if(jsonData.status == '2'){
			return '出款失败'
		}
		else if(jsonData.status == '3'){
			return '出款退回'
		}
		else if(jsonData.status == '4'){
			return '出款处理中'
		}
		else if(jsonData.status == '5'){
			return '待审核'
		}
		return ''
	}
	// 拨打电话
	const callMakeTel = ()=>{
		uni.makePhoneCall({
			phoneNumber:CUSTOMSERVICE_TEL
		})
	}
</script>

<style lang="scss" scoped>
.withdrawal-record-detail-layout{
	padding: 0 30rpx 30rpx;
	background-color: #fff;
	min-height: 100vh;
	.withdrawal-record-detail-status{
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 60rpx;
		border-bottom: 1px dotted #eee;
		image{
			width: 80rpx;
			height: 80rpx;
			margin-bottom: 16rpx;
		}
		
	}
	.withdrawal-record-detail-info{
		margin-top: 50rpx;
		.withdrawal-record-detail-cell{
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: 26rpx;
			&:nth-child(n + 2) {
				margin-top: 20rpx;
			}
		}
	}
	.withdrawal-record-detail-bottom{
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 24rpx;
		color: $xh-color-6;
		margin-top: 100rpx;
		text:nth-child(2) {
			color: $xh-theme-color;
			margin-left: 6rpx;
		}
	}
}
</style>
